import request from '@/utils/request'
import { method } from 'lodash'
export const enterArticlesAPI = (article_id) => {
  return request({
    url: `/v1_0/articles/${article_id}`
  })
}

/**
 *
 * 添加收藏
 */
export const addCollect = (target) => {
  return request({
    url: '/v1_0/article/collections',
    method: 'POST',
    data: {
      target
    }
  })
}

/**
 *
 * 取消收藏
 */
export const deleteCollect = (target) => {
  return request({
    url: `/v1_0/article/collections/${target}`,
    method: 'DELETE'
  })
}

/**
 *
 * 添加点赞
 */
 export const addLike = (target) => {
  return request({
    url: '/v1_0/article/likings',
    method: 'POST',
    data: {
      target
    }
  })
}

/**
 *
 * 取消点赞
 */
export const deleteLike = (target) => {
  return request({
    url: `/v1_0/article/likings/${target}`,
    method: 'DELETE'
  })
}
